<template>
  <div class="druglist">
      <div class="search">
        <div class="typeimg1" @click="goback()"><img src="../../static/img/home_back.png"/></div>
        <div class="searchin" @click="gosearchpage()">
          <div v-text="searchname" class="searchname ellipisis"></div><span></span><img src="../../static/img/home_search.png"/>
        </div>
        <div class="typeimg" @click="goseek()"><img src="../../static/img/home_type.png"/></div>
      </div>
      <screening></screening>
      <div class="content paddingtop2">
        <productlist :liststyle="liststyle" :showmore="true"></productlist>
      </div>
  </div> 
</template>

<script>
import Mock from 'mockjs'
import productlist from 'components/productlist'
import screening from 'components/screening'

export default {
  name: 'druglist',
  props : [],
  data () {
    return {
      liststyle:'proin',//初始列表样式
      allLoaded:false,
      searchname:'',
      id:''
    }
  },
  components: {
      productlist,
      screening
  },
  methods : {
      goseek(){
        this.$router.push({ name: 'seekclass'});
      },
      gosearchpage(){
        this.$router.push({ name: 'searchpage', query: { historypage: 'druglist' }})
      }
  },
  mounted(){
      var params = this.$route.query;
      //从搜索页面进入的
      if(params.historypage == 'searchpage'){
        this.searchname = params.val;
      }
  }
}

</script>

<style lang="scss" scoped>
  $blue:#51b6e1;
  .search{
    z-index: 1;
    display: flex;
    height:40px;
    text-align: center;
    background-color: $blue;
    position: fixed;
    width: 100%;
    .searchin{
      text-align: right;
      margin: 5px 20px 5px 0px;
      width: 70%;
      margin-left: 20px;
      position: relative;
      background-color:#ffffff;
      .searchname{
        position: absolute;
        left: 5px;
        line-height: 30px;
        width:85%;
        text-align: left;
      }
      span{
        height:100%;
        display:inline-block;
        vertical-align: middle;
      }
      img{
        width: 20px;
        margin-right: 10px;
        vertical-align: middle;
      }
    }
    .typeimg1{
      position: relative;
      top: 3px;
      left: 10px;
    }
    .typeimg{
      text-align: left;
      position:relative;
      top: 3px;
      right:10px;
    }
    .searchinput{
      .mint-search{
        position:relative;
      }
    }
  }
  .content{

  }
</style>
